library(tidyverse)
library(DeclareDesign)
library(rdss)

sims <- 2000
bootstrap_sims <- FALSE

source("code/declarations/declaration_11.3.R")

diagnosands <-
  declare_diagnosands(cost = unique(N * 2 + prob * N * 20),
                      rmse = sqrt(mean((estimate - estimand) ^ 2)))

diagnosis_11.3 <-
  declaration_11.3 |>
  redesign(N = seq(100, 1000, 10),
           prob = seq(0.1, 0.5, 0.2)) |>
  diagnose_designs(diagnosands = diagnosands, sims = sims, bootstrap_sims = bootstrap_sims)

write_rds(diagnosis_11.3, file = "diagnosis_objects/diagnosis_11.3.rds")